<?php
namespace Admin\Controller;

use Common\Controller\AdminbaseController;

class MainController extends AdminbaseController
{

    public function index()
    {

        $mysql = M()->query("select VERSION() as version");
        $mysql = $mysql[0]['version'];
        $mysql = empty($mysql) ? L('UNKNOWN') : $mysql;

        //server infomaions
        $info = [
            L('OPERATING_SYSTEM')      => PHP_OS,
            L('OPERATING_ENVIRONMENT') => $_SERVER["SERVER_SOFTWARE"],
            L('PHP_VERSION')           => PHP_VERSION,
            L('PHP_RUN_MODE')          => php_sapi_name(),
            L('PHP_VERSION')           => phpversion(),
            L('MYSQL_VERSION')         => $mysql,
            L('PROGRAM_VERSION')       => THINKCMF_VERSION,
            L('UPLOAD_MAX_FILESIZE')   => ini_get('upload_max_filesize'),
            L('MAX_EXECUTION_TIME')    => ini_get('max_execution_time') . "s",
            L('DISK_FREE_SPACE')       => round((@disk_free_space(".") / (1024 * 1024)), 2) . 'M',
        ];
        $this->assign('server_info', $info);
        $this->display();
    }
}